package com.ss.android.article.base.feature.e;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.app.BizApplication;
import com.ss.android.article.base.feature.pgc.PgcActivity;
import com.ss.android.article.base.ui.BaseActionDialog.DisplayMode;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.share.helper.CommonCopylinkHelper;
import com.ss.android.article.common.share.helper.CommonHtmlShareHelper;
import com.ss.android.article.common.share.helper.CommonSystemShareHelper;
import com.ss.android.article.share.e.b;
import com.ss.android.common.dialog.AlertDialog;

final class c implements b {
    private final ArticleShareHelper mArticleShareHelper;

    c(ArticleShareHelper arg1) {
        this.mArticleShareHelper = arg1;

    }

    public final boolean a(com.ss.android.article.share.entity.a arg13, View arg14, com.ss.android.article.share.c.a arg15) {
        Object v1_3;
        Object[] v1_2;
        Object[] v0_2;
        String v6;
        long v4;
        long v2;
        int v7 = -1;
        int v11 = 2;
        int v10 = 3;
        boolean v8 = false;
        if(arg13 != null && this.mArticleShareHelper.mActivity != null && this.mArticleShareHelper.mArticle != null) {
            boolean v0 = this.mArticleShareHelper.g != null ? this.mArticleShareHelper.g.a(arg13, arg14, arg15) : false;
            if(v0) {
                return true;
            }

            switch(arg13.e) {
                case 1: {
                    label_30:
                    this.mArticleShareHelper.shareToWechat(1);
                    return true;
                }
                case 2: {

                    label_26:
                    this.mArticleShareHelper.shareToWechat(0);
                    return true;
                }
                case 3: {
                    this.mArticleShareHelper.shareToQQ();
                    return true;
                }
                case 4: {
                    mArticleShareHelper.a(this.mArticleShareHelper);
                    return true;
                }
                case 10:
                {
                    if(mArticleShareHelper.mActivity != null && mArticleShareHelper.mArticle != null && !android.support.design.a.isTextEmpty(mArticleShareHelper.mArticle.title)) {
                        mArticleShareHelper.a("share_system");
                        mArticleShareHelper.a("rt_share_to_platform", mArticleShareHelper.position, "system");
                        new CommonSystemShareHelper(mArticleShareHelper.mActivity).a(mArticleShareHelper.mArticle);
                        return true;
                    }
                    return true;
                }
                case 11: {
                    if(mArticleShareHelper.mActivity != null && mArticleShareHelper.mArticle != null && mArticleShareHelper.h != null) {
                        mArticleShareHelper.h.shareContent(mArticleShareHelper.mArticle.groupId);
                        new CommonHtmlShareHelper(mArticleShareHelper.mActivity).a(mArticleShareHelper.mArticle, new Object[0]);
                        mArticleShareHelper.a("share_content");
                        return true;
                    }
                    return true;
                }
                case 12: {

                    if(this.mArticleShareHelper.mArticle != null && this.mArticleShareHelper.mArticle.mediaInfo != null) {
                        if(this.mArticleShareHelper.mDisplayMode == DisplayMode.VIDEO_MORE) {
                            v7 = 0;
                        }

                        Activity v1 = this.mArticleShareHelper.mActivity;
                        v2 = this.mArticleShareHelper.mArticle.mediaInfo.id;
                        v4 = this.mArticleShareHelper.mArticle.itemId;
                        v6 = android.support.design.a.isTextEmpty(this.mArticleShareHelper.p) ? "article_more" : this.mArticleShareHelper.p;
                        PgcActivity.startActivity(v1, v2, v4, v6, v7);
                        v0_2 = new Object[v10];
                        v0_2[0] = Integer.valueOf(v10);
                        v0_2[1] = arg13.g;
                        v0_2[v11] = this.mArticleShareHelper;
                        mArticleShareHelper.a(v0_2);
                        return true;
                    }

                    if(this.mArticleShareHelper.l == null) {
                        return v8;
                    }

                    if(this.mArticleShareHelper.l.mMediaInfo == null) {
                        return v8;
                    }

                    if(this.mArticleShareHelper.mDisplayMode == DisplayMode.VIDEO_MORE) {
                        v7 = 0;
                    }

                    v4 = this.mArticleShareHelper.mArticle != null ? this.mArticleShareHelper.mArticle.itemId : this.mArticleShareHelper.l.groupItemId;
                    Activity v1 = this.mArticleShareHelper.mActivity;
                    v2 = this.mArticleShareHelper.l.mMediaInfo.id;
                    v6 = android.support.design.a.isTextEmpty(this.mArticleShareHelper.p) ? "article_more" : this.mArticleShareHelper.p;
                    PgcActivity.startActivity(((Context)v1), v2, v4, v6, v7);
                    v0_2 = new Object[v10];
                    v0_2[0] = Integer.valueOf(v10);
                    v0_2[1] = arg13.g;
                    v0_2[v11] = this.mArticleShareHelper;
                    mArticleShareHelper.a(v0_2);
                    return true;
                }
                case 13:
                    ArticleShareHelper v0_1;
                {
                    v0_1 = this.mArticleShareHelper;
                    if(v0_1.mArticle.userRepin) {
                        v0_1.mArticle.userRepin = false;
                        --v0_1.mArticle.repinCount;
                        if(v0_1.mArticle.repinCount < 0) {
                            v0_1.mArticle.repinCount = 0;
                        }

                        v0_1.mActionHelper.a(5, v0_1.mArticle, v0_1.c);
                        v0_1.a(0, R.string.toast_unfavor);
                        v1_2 = new Object[v10];
                        v1_2[0] = Integer.valueOf(v11);
                        v1_2[1] = v0_1.mArticle;
                        v1_2[v11] = v0_1;
                        mArticleShareHelper.a(v1_2);
                        arg13.f = false;
                        arg13.d = BizApplication.getApplication().getString(com.ss.android.article.browser.R.string.bs);
                        v1_3 = arg14.getTag();
                        if(!(v1_3 instanceof com.ss.android.article.share.a.a.a$a)) {
                        }else {
                            ((com.ss.android.article.share.a.a.a$a)v1_3).b.setText(arg13.d);
                            ((com.ss.android.article.share.a.a.a$a) v1_3).c.setSelected(false);
                        }
                    }
                    else {
                        v0_1.mArticle.userRepin = true;
                        ++v0_1.mArticle.repinCount;
                        v0_1.mActionHelper.a(4, v0_1.mArticle, v0_1.c);
                        AppData.getInstance();
                        AppData.isNightMode();
                        v0_1.a(com.ss.android.article.browser.R.drawable.doneicon_popup_textpage, R.string.toast_favor);
                        v1_2 = new Object[v10];
                        v1_2[0] = Integer.valueOf(1);
                        v1_2[1] = v0_1.mArticle;
                        v1_2[v11] = v0_1;
                        mArticleShareHelper.a(v1_2);
                        arg13.f = true;
                        arg13.d = BizApplication.getApplication().getString(com.ss.android.article.browser.R.string.c6);
                        v1_3 = arg14.getTag();
                        if(!(v1_3 instanceof com.ss.android.article.share.a.a.a$a)) {
                        }else {
                            ((com.ss.android.article.share.a.a.a$a)v1_3).b.setText(arg13.d);
                            ((com.ss.android.article.share.a.a.a$a) v1_3).c.setSelected(true);
                        }
                    }

                    label_234:
                    arg15.e();
                    return true;
                }
                case 16: {
                    v0_1 = this.mArticleShareHelper;
                    if(v0_1.mArticle != null) {
                        v0_1.a("report_button");
                        if(v0_1.mArticle != null && v0_1.mDetailHelper != null) {
                            v0_1.mDetailHelper.a(v0_1.mArticle, v0_1.c);
                        }
                    }
                    return true;
                }
                case 17: {
                    new CommonCopylinkHelper(this.mArticleShareHelper.mActivity).a(this.mArticleShareHelper.mArticle);
                    mArticleShareHelper.a(this.mArticleShareHelper, "rt_share_to_platform", mArticleShareHelper.b(this.mArticleShareHelper), "copy");
                    return true;
                }
                case 21: {
                    this.mArticleShareHelper.a(true, arg15);
                    return true;
                }
                case 22: {
                    this.mArticleShareHelper.a(false, arg15);
                    return true;
                }
                case 23: {
                    if(mArticleShareHelper.mActivity != null) {
                        AppData.getInstance();
                        AlertDialog.Builder dialogBuilder = com.ss.android.j.b.createDialogBuilder((mArticleShareHelper.mActivity));
                        dialogBuilder.setMessage(com.ss.android.article.browser.R.string.tip_delete_answer);
                        dialogBuilder.setNegativeButton(com.ss.android.article.browser.R.string.label_cancel, null);
                        dialogBuilder.setPositiveButton(com.ss.android.article.browser.R.string.label_ok, mArticleShareHelper.mDeleteAnswerConfirmListener);
                        dialogBuilder.show();
                    }
                    return true;
                }
                case 38: {
                    if(mArticleShareHelper.x != null) {
                        mArticleShareHelper.x.mFeedVideoViewHolder.FeedItemBehavior.handlePopIconClick(mArticleShareHelper.x.mFeedVideoViewHolder.aS, mArticleShareHelper.x.mFeedVideoViewHolder.as, 0);
                    }

                    return true;
                }
            }

            arg15.e();
            return v8;
        }

        return v8;
    }
}

